package net.framework.smc.kafka.controller;

import lombok.extern.slf4j.Slf4j;
import net.framework.smc.kafka.channel.MySource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class SendController {

    @Autowired
    MySource mySource;

    @RequestMapping("/send")
    public String send(){
        mySource.output().send(MessageBuilder.withPayload("hellow world").build());
        return "success";
    }
}
